<?php 
namespace Common\Model;
use Think\Model\RelationModel;
class YgclOrderModel extends RelationModel{
	protected $_link = array(
			'user' => array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name'  =>'Users',
					'foreign_key'=>'uid',
			),
			'term' => array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name'  =>'YgclTerm',
					'foreign_key'=>'termid',
			),
			'xiaoqu' => array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name'  =>'YgclDistrict',
					'foreign_key'=>'did',
			),
			'kecheng' => array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name'  =>'YgclClass',
					'foreign_key'=>'cid',
			),
			'lesson'=>array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name'  =>'YgclLesson',
					'foreign_key'=>'lid',
					//'as_fields'=>'title:class',
			),
			'detail'=>array(
					'mapping_type'=>self::HAS_ONE,
					'class_name'  =>'YgclOrderDetail',
					'foreign_key'=>'orderid',
					'mapping_order'=> 'id desc',
					//'as_fields'=>'title:class',
			)
	);
}
?>